{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "csrftoken=iGs97uuN0NfsrcvgrCL94dIdLx92cvLTSDffsx5kDEDPSKaoZBqEVCgSV28WQGCW\n",
      "/api/captcha/image/a71d21bdedf4395eb2a97e12ea6a3f38874494d9/\n",
      "{'crsftoken': 'iGs97uuN0NfsrcvgrCL94dIdLx92cvLTSDffsx5kDEDPSKaoZBqEVCgSV28WQGCW'}\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "Base_Url=\"http://www.fxdayu.com\"\n",
    "Session=requests.session()\n",
    "headers={\"User-Agent\":\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0\"}\n",
    "# cookies={\"csrftoken\":\"xSGNsmeZEDLDsloSsZwxU69sql8mra8fDsa3iU6RphQDiEFAMXl62rBnxbIMB1ky\"}\n",
    "r=Session.get(\"http://www.fxdayu.com/accounts/login/\",headers=headers)\n",
    "token=r.headers[\"Set-Cookie\"].split(\";\")[0]\n",
    "print(token)\n",
    "headers[\"Set-Cookie\"]=token\n",
    "cookies={\"crsftoken\":token.split(\"=\")[1]}\n",
    "bsObj=BeautifulSoup(r.text,\"lxml\")\n",
    "url=bsObj.find(\"img\",{\"id\":\"id_password_form-captcha_image\"})\n",
    "value=(bsObj.find(\"input\",{\"id\":\"id_password_form-captcha_0\"}))[\"value\"]\n",
    "csrfmiddlewaretoken=(bsObj.find(\"input\",{\"name\":\"csrfmiddlewaretoken\"}))[\"value\"]\n",
    "print(url[\"src\"])\n",
    "url=Base_Url+url[\"src\"]\n",
    "data={\n",
    "    \"csrfmiddlewaretoken\":csrfmiddlewaretoken,#crsf验证，防止crsf攻击\n",
    "    \"password_form\":\"登录\",\n",
    "    \"password_form-captcha_0\":value,\n",
    "    \"password_form-captcha_1\":\"\",#留着更新验证码\n",
    "    \"password_form-login\":\"***请输入你的账号***\",#请输入你的账号\n",
    "    \"password_form-password\":\"***请输入你的密码***\"#请输入你的密码\n",
    "     }\n",
    "import time\n",
    "r=Session.get(\"http://www.fxdayu.com/navbar/top/account?t=%s\"%int(time.time()),headers=headers)\n",
    "print(cookies)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAACtCAYAAACgJYQAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJztnXmQXNWV5r+jfWHRVhJaAAkkxI6WAsRiFrEJaCNswCCgYQLZjGd6AnB0GONxxISJmIjBbne3u2faniCMpmlMsJlN7AiBjAGzlBYQ2tAGQnuhnUUbuvNHpbLu+arqvXrKrMzk8f0iFPVOvsz3Tr538yrzu+d+10IIEEII8c2nU7UTEEIIUR7UoQshRE5Qhy6EEDlBHboQQuQEdehCCJET1KELIUROUIcuhBA5QR26EELkhJI6dDObZGZLzGyZmd1VrqSEEEJkxw50pqiZdQbwEYCLAKwG8B6AKSGEhW29ZsCAAWH48OHFePa82W7/+DHjDygXIURliT+7/Lkt9+c66Vyl0pHHLgW+hvgan4UQ6tJeV0qHfgaAX4YQLinEPweAEML/aus19fX1oaGhofkY/cztD5tlQyDEN4H4s8uf23J/rpPOVSodeexS4GuILZgdQqhPe10pkstQAJ9G8erCYz4xs1vNrMHMGhobG0s4nRBCiCRK6dCtlcda/BcXQrg3hFAfQqivq0v9xSCEEOIA6VLCa1cDODyKhwFYm+UAjcv8N/bPNn/W5nOnPz/dxVdcdoWLB/QbkOXUZSUpb6bceZbz3HysaX+c5uLJl052cf/+/dt97LyS5foD35zrlNYWFr+zuLi9ZOkSty/L5xpo+dk+6/Sz2jweH6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A2gqevz1sMLPBAFD4u7EaSZhZVzR15g+GEJ6opdz2E0LYCmAWmnT+PmbWpbCrGvf1LABXmNnHAB5Gk+zy2xrICwAQQlhb+LsRTVrwaaj+/VwNYHUI4Z1C/Cc0dfDVzivmUgBzQggbCnG1c7sQwMoQQmMIYQ+AJwCciRppZ0BlO/T3AIwqjAh3Q9NPqekpr6k00wHcXNi+GU36dUUxMwNwH4BFIYR/qrHc6sysT2G7J5oa+CIArwG4ulq5hRB+HkIYFkIYjqZ29WoI4YZq5wUAZtbbzA7ev40mTfhDVPl+hhDWA/jUzEYXHroAwMJq50VMQbPcAlQ/t1UAJphZr8LndP81q3o7K1LhQYXLAHyEJt31F9UaOCjk8hCadLA9aPq2MhVNuutMAEsLf/tVIa+z0fST7QMA8wr/LquR3E4GMLeQ24cA/kfh8aMAvAtgGZp+Hnev4n09D8CztZJXIYf3C/8W7G/3NXI/xwBoKNzPpwD0rYW8Crn1ArAJwKHRY1XPDcDdABYX2v8DALrXQjvb/08zRYUQIidopqgQQuQEdehCCJET1KELIUROUIcuhBA5QR26EELkBHXoQgiRE9ShCyFETlCHLoQQOeH/A5c1/PhW7wXsAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "smvl\n",
      "{'csrfmiddlewaretoken': '6JoA4zzsYKorIuo4y9bzc9uaddKS4JPFGGbGpCaZBBMO923c68Q43y2PnIJMIUGI', 'password_form': '登录', 'password_form-captcha_0': 'a71d21bdedf4395eb2a97e12ea6a3f38874494d9', 'password_form-captcha_1': 'smvl', 'password_form-login': '18955993726@163.com', 'password_form-password': 'q1w2e3r4'}\n"
     ]
    }
   ],
   "source": [
    "from PIL import Image\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "with open(\"a.png\",\"wb\") as f:\n",
    "    r=Session.get(url)\n",
    "    f.write(r.content)\n",
    "\n",
    "image=Image.open(\"a.png\")\n",
    "plt.imshow(image)\n",
    "plt.show()\n",
    "captcha=input()\n",
    "data[\"password_form-captcha_1\"]=captcha\n",
    "print(data)\n",
    "r=Session.post(\"http://www.fxdayu.com/accounts/login/?\",data=data,headers=headers,cookies=cookies,allow_redirects=False)\n",
    "r.cookies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "r.encoding=\"utf-8\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=Session.get(\"http://www.fxdayu.com/static/standalone/tutorials.html?article=76\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "r.encoding=\"utf-8\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<!DOCTYPE html>\n",
      "<html lang=\"zh-CN\">\n",
      "\n",
      "<head>\n",
      "<meta charset=\"utf-8\">\n",
      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n",
      "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n",
      "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n",
      "<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->\n",
      "<meta name=\"application-name\" content=\"大鱼金融－国内领先的量化投资解决方案提供商\">\n",
      "<meta name=\"keywords\"\n",
      "\tcontent=\"量化课程,数据分析,金融投资,量化投资,量化交易,量化工具,量化引擎,量化研究,量化交易,策略研究,策略社区,python,大鱼金融,自动交易,专业量化,国内量化\">\n",
      "<meta name=\"description\"\n",
      "\tcontent=\"大鱼学院给交易爱好者提供从零开始走上宽客之路的免费教学，让大家可以快速掌握做交易要用到的基础代码知识，做到科学客观的量化交易，促进量化领域爱好者的交流成长，互相学习。本课程对交易针对性强，视频制作以精简实用为主，并配有文字与代码的说明。\">\n",
      "<meta name=\"author\" content=\"大鱼金融\">\n",
      "<title>大鱼学院</title>\n",
      "<link rel=\"icon\" href=\"imgs/litLogoNew.png\">\n",
      "<!-- Bootstrap core CSS -->\n",
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.css\">\n",
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"libs/css/editormd.min.css\">\n",
      "<link rel=\"stylesheet\" type=\"text/css\"\n",
      "\thref=\"css/zuoyebuluo.layout.min.css\">\n",
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/iconfont.css\">\n",
      "<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->\n",
      "<link href=\"libs/css/ie10-viewport-bug-workaround.css\" rel=\"stylesheet\">\n",
      "<!-- Custom styles for this template -->\n",
      "<link href=\"libs/css/blog.css\" rel=\"stylesheet\">\n",
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/common.css\">\n",
      "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/tutorials.css\">\n",
      "<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->\n",
      "<!--[if lt IE 9]><script src=\"../../assets/js/ie8-responsive-file-warning.js\"></script><![endif]-->\n",
      "<script src=\"libs/js/ie-emulation-modes-warning.js\"></script>\n",
      "<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n",
      "<!--[if lt IE 9]>\n",
      "      <script src=\"https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n",
      "      <script src=\"https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js\"></script>\n",
      "    <![endif]-->\n",
      "<script type=\"text/javascript\" src=\"https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js\"></script>\n",
      "<script type=\"text/javascript\" src=\"https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js\"></script>\n",
      "</head>\n",
      "<body>\n",
      "\t\t<nav class=\"navbar\" role=\"navigation\" id=\"headNav\">\n",
      "\t\t\t\t<div class=\"container-fluid\">\n",
      "\t\t\t\t\t<!-- Brand and toggle get grouped for better mobile display -->\n",
      "\t\t\t\t\t<div class=\"navbar-header\">\n",
      "\t\t\t\t\t\t<button type=\"button\" class=\"navbar-toggle navbarToggleStyle\"\n",
      "\t\t\t\t\t\t\tdata-toggle=\"collapse\" data-target=\"#collapseNav\">\n",
      "\t\t\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span> <span\n",
      "\t\t\t\t\t\t\t\tclass=\"glyphicon glyphicon-menu-hamburger menuStyle\"></span>\n",
      "\t\t\t\t\t\t</button>\n",
      "\t\t\t\t\t\t<a class=\"navbar-brand navImgA\" href=\"#\"> <img\n",
      "\t\t\t\t\t\t\tsrc=\"imgs/logo.png\" class=\"navImg\" alt=\"logo\">\n",
      "\t\t\t\t\t\t</a>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<!-- Collect the nav links, forms, and other content for toggling -->\n",
      "\t\t\t\t\t<div class=\"collapse navbar-collapse\" id=\"collapseNav\">\n",
      "\t\t\t\t\t\t<ul class=\"nav navbar-nav navbar-right\" id=\"titleUl\">\n",
      "\t\t\t\t\t\t\t<!--<li><a href=\"strategyMall.html\">策略超市</a></li>-->\n",
      "\t\t\t\t\t\t\t<li><a href=\"index.html\">首页</a></li>\n",
      "\t\t\t\t\t\t\t<li><a href=\"strategyMall.html\">策略商城</a></li>\n",
      "\t\t\t\t\t\t\t<li><a href=\"dataMarket.html\">数据市集</a></li>\n",
      "\t\t\t\t\t\t\t<li><a href=\"#\">大鱼学院</a>\n",
      "\t\t\t\t\t\t\t\t<ul class=\"dropdownMenu\">\n",
      "\t\t\t\t\t\t\t\t\t<li><a href=\"tutorialType.html\">线上教程</a></li>\n",
      "\t\t\t\t\t\t\t\t\t<li><a id=\"coding\" href=\"#\" title=\"大鱼金融\"  data-container=\"body\" data-toggle=\"popover\" data-placement=\"left\" data-content=\"即将上线，敬请期待...\">线下工作坊</a></li>\n",
      "\t\t\t\t\t\t\t\t</ul>\n",
      "\t\t\t\t\t\t\t</li>\n",
      "\t\t\t\t\t\t\t<li><a href=\"http://bbs.fxdayu.com\">大鱼社区</a></li>\n",
      "\t\t\t\t\t\t\t<li>\n",
      "\t\t\t\t\t\t\t\t<a href=\"#\" data-target=\"#\" href=\"http://example.com\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">帮助</a>\n",
      "\t\t\t\t\t\t\t\t<ul class=\"dropdownMenu\">\n",
      "\t\t\t\t\t\t\t\t\t<li><a href=\"help.html\">关于</a></li>\n",
      "\t\t\t\t\t\t\t\t\t<li><a target=\"_blank\" href=\"https://github.com/xingetouzi/jaqs-fxdayu/tree/master\">选股框架</a></li>\n",
      "\t\t\t\t\t\t\t\t</ul>\n",
      "\t\t\t\t\t\t\t</li>\n",
      "\t\t\t\t\t\t\t<!-- <li><a href=\"login.html\">登录</a></li>\n",
      "\t\t\t\t\t\t\t<li><a href=\"sign.html\">注册</a></li> -->\n",
      "\t\t\t\t\t\t</ul>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<!-- /.navbar-collapse -->\n",
      "\t\t\t\t</div>\n",
      "\t\t\t\t<!-- /.container-fluid -->\n",
      "\t\t\t</nav>\n",
      "\t<div class=\"container-fluid\" id=\"content\">\n",
      "\t\t<ul class=\"nav nav-pills\" role=\"tablist\" id=\"secondUl\">\n",
      "\t\t\t<li role=\"presentation\" class=\"secondTitle active\"><a href=\"#articleTab\">文章</a></li>\n",
      "\t\t\t<li role=\"presentation\" class=\"secondTitle\"><a href=\"#videoTab\">视频</a>\n",
      "\t\t\t</li>\n",
      "\t\t\t<li class=\"returnMenu\"><a href=\"tutorialType.html\">返回</a></li>\n",
      "\t\t</ul>\n",
      "\t\t<div class=\"row\" id=\"articleMenu\">\n",
      "\t\t\t<div class=\"col-sm-3 col-md-2 col-lg-2 blog-sidebar\" id=\"sideBar\">\n",
      "\t\t\t\t<div class=\"sidebar-module\" id=\"menuDiv\">\n",
      "\t\t\t\t\t<ul class=\"list-unstyled\" id=\"leftMenu\"\n",
      "\t\t\t\t\t\tdata-bind=\"foreach:childMenu\">\n",
      "\t\t\t\t\t\t<li\n",
      "\t\t\t\t\t\t\tdata-bind=\"attr:{class:childClass,id:childId}\">\n",
      "\t\t\t\t\t\t\t<a data-bind=\"text:childName,attr:{href:artHref}\"></a>\n",
      "\t\t\t\t\t\t</li>\n",
      "\t\t\t\t\t</ul>\n",
      "\t\t\t\t</div>\n",
      "\t\t\t</div>\n",
      "\t\t\t<!-- /.blog-sidebar -->\n",
      "\t\t\t<div class=\"col-sm-8 col-md-9 col-lg-9 blog-main\">\n",
      "\t\t\t\t<div class=\"tab-content blog-post\">\n",
      "\t\t\t\t\t<div role=\"tabpanel\" class=\"tab-pane active\" id=\"articleTab\"></div>\n",
      "\t\t\t\t\t<div role=\"tabpanel\" class=\"tab-pane\" id=\"videoTab\">\n",
      "\t\t\t\t\t\t<!-- 16:9 aspect ratio -->\n",
      "\t\t\t\t\t\t<div class=\"embed-responsive embed-responsive-16by9\" id=\"videoDiv\">\n",
      "\t\t\t\t\t\t\t<img alt=\"video\" src=\"imgs/video.png\" class=\"img-responsive\"\n",
      "\t\t\t\t\t\t\t\tid=\"videoImg\">\n",
      "\t\t\t\t\t\t\t<h1 id=\"noPartVideo\">该分类下暂无视频！</h1>\n",
      "\t\t\t\t\t\t\t<h1 id=\"noVideo\">该文章暂无相应视频！</h1>\n",
      "\t\t\t\t\t\t\t<div id=\"loading\">\n",
      "\t\t\t\t\t\t\t\t<div id=\"loading-center\">\n",
      "\t\t\t\t\t\t\t\t\t<div id=\"loading-center-absolute\">\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t\t<div class=\"object\"></div>\n",
      "\t\t\t\t\t\t\t\t\t</div>\n",
      "\t\t\t\t\t\t\t\t</div>\n",
      "\t\t\t\t\t\t\t</div>\n",
      "\t\t\t\t\t\t</div>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<nav aria-label=\"Page navigation\" id=\"pagerNav\">\n",
      "\t\t\t\t\t\t<ul class=\"pager\">\n",
      "\t\t\t\t\t\t\t<li id=\"preAct\"><a data-bind=\"attr:{href:preHref}\" class=\"previous\"> \n",
      "\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-chevron-left\"></span>\n",
      "\t\t\t\t\t\t\t</a></li>\n",
      "\t\t\t\t\t\t\t<li id=\"nextAct\"><a data-bind=\"attr:{href:nextHref}\" class=\"next\"> \n",
      "\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-chevron-right\"></span>\n",
      "\t\t\t\t\t\t\t</a></li>\n",
      "\t\t\t\t\t\t</ul>\n",
      "\t\t\t\t\t</nav>\n",
      "\t\t\t\t</div>\n",
      "\t\t\t</div>\n",
      "\t\t</div>\n",
      "\t</div>\n",
      "\t<a id=\"back-to-top\" href=\"#\" class=\"btn btn-lg back-to-top\"\n",
      "\t\trole=\"button\" title=\"回到顶部\" data-toggle=\"tooltip\" data-placement=\"top\">\n",
      "\t\t<span class=\"glyphicon glyphicon-chevron-up\"></span>\n",
      "\t</a>\n",
      "\t<footer class=\"footer\">\n",
      "\t\t<div class=\"container\">\n",
      "\t\t\t<div class=\"row\" id=\"company\">\n",
      "\t\t\t\t<div\n",
      "\t\t\t\t\tclass=\"col-xs-12 col-sm-12 col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1\">\n",
      "\t\t\t\t\t<div class=\"col-xs-2 col-sm-2 col-md-2 col-lg-2\">\n",
      "\t\t\t\t\t\t<h2>关于</h2>\n",
      "\t\t\t\t\t\t<h4>\n",
      "\t\t\t\t\t\t\t<a href=\"help.html?article=1\" class=\"toHelp\">关于我们</a>\n",
      "\t\t\t\t\t\t</h4>\n",
      "\t\t\t\t\t\t<h4>\n",
      "\t\t\t\t\t\t\t<a href=\"help.html?article=2\" class=\"toHelp\">联系我们</a>\n",
      "\t\t\t\t\t\t</h4>\n",
      "\t\t\t\t\t\t<h4>\n",
      "\t\t\t\t\t\t\t<a href=\"help.html?article=3\" class=\"toHelp\">加入我们</a>\n",
      "\t\t\t\t\t\t</h4>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<div class=\"col-xs-2 col-sm-2 col-md-2 col-lg-2\">\n",
      "\t\t\t\t\t\t<h2>服务</h2>\n",
      "\t\t\t\t\t\t<h4>新手指引</h4>\n",
      "\t\t\t\t\t\t<h4>快速了解</h4>\n",
      "\t\t\t\t\t\t<h4>常见问题</h4>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<div class=\"col-xs-2 col-sm-2 col-md-2 col-lg-2\">\n",
      "\t\t\t\t\t\t<h2>安全</h2>\n",
      "\t\t\t\t\t\t<h4>安全保障</h4>\n",
      "\t\t\t\t\t\t<h4>风险控制</h4>\n",
      "\t\t\t\t\t\t<h4>法律条款</h4>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">\n",
      "\t\t\t\t\t\t<h2>联系我们</h2>\n",
      "\t\t\t\t\t\t<h4>客服QQ:372592121</h4>\n",
      "\t\t\t\t\t\t<h4>Email:public@fxdayu.com</h4>\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<div class=\"col-xs-2 col-sm-2 col-md-2 col-lg-2\">\n",
      "\t\t\t\t\t\t<h2>了解更多</h2>\n",
      "\t\t\t\t\t\t<img src=\"imgs/qrCode.jpg\" class=\"img-responsive\" alt=\"code\">\n",
      "\t\t\t\t\t</div>\n",
      "\t\t\t\t\t<div class=\"col-xs-12 col-sm-12 col-md-12 text-center\"\n",
      "\t\t\t\t\t\tid=\"copyright\">©2015-2017 Fxdayu.com All Rights Reserved\n",
      "\t\t\t\t\t\t版权所有丨粤ICP备15080153号</div>\n",
      "\t\t\t\t</div>\n",
      "\t\t\t</div>\n",
      "\t\t</div>\n",
      "\t</footer>\n",
      "\t<script type=\"text/javascript\" src=\"https://cdn.bootcss.com/knockout/3.4.0/knockout-min.js\"></script>\n",
      "\t<script type=\"text/javascript\" src=\"js/config.js\"></script>\n",
      "\t<script type=\"text/javascript\" src=\"js/tutorials.js\"></script>\n",
      "</body>\n",
      "\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(r.text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=Session.get(\"http://www.fxdayu.com/navbar/top/account?t=1537440997\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n\\n\\n<li id=\"userCenter\">\\n    <a href=\"#\">leon_X</a>\\n    <ul class=\"dropdownMenu\">\\n        <li><a href=\"userCenter.html\">个人主页</a></li>\\n        <li><a href=\"/accounts/logout/\">登出</a></li>\\n    </ul>\\n</li>\\n'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=Session.get(\"http://www.fxdayu.com/tutorialType.html\")\n",
    "r=Session.get(\"http://www.fxdayu.com/tutorials/doc_content/75/\")\n",
    "\n",
    "url=(r.json())['zy_url']\n",
    "r=Session.get(url)\n",
    "with open(\"1.html\",\"w\",encoding=\"utf-8\") as f:\n",
    "    f.write(r.text)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
